package com.cardone.platform.authority.service;

import java.util.List;

import lombok.Getter;
import lombok.Setter;

import com.cardone.common.dto.PaginationDto;
import com.cardone.context.ContextHolder;
import com.cardone.platform.authority.dao.UsGroupOrgDao;
import com.cardone.platform.authority.dto.UsGroupOrgDto;

/**
 * 用户组与组织服务
 *
 * @author yaohaitao
 *
 */
@Getter
@Setter
public class UsGroupOrgDefaultService implements UsGroupOrgService {
	@Override
	public int deleteByIds(final UsGroupOrgDto deleteUsGroupOrg) {
		return ContextHolder.getBean(UsGroupOrgDao.class).deleteByIds(deleteUsGroupOrg);
	}

	@Override
	public <P> P findByCodeOrId(final Class<P> mappedClass, final UsGroupOrgDto findUsGroupOrg) {
		return ContextHolder.getBean(UsGroupOrgDao.class).findByCodeOrId(mappedClass, findUsGroupOrg);
	}

	@Override
	public <P> P findById(final Class<P> mappedClass, final UsGroupOrgDto findUsGroupOrg) {
		return ContextHolder.getBean(UsGroupOrgDao.class).findById(mappedClass, findUsGroupOrg);
	}

	@Override
	public <P> List<P> findListByLikeCode(final Class<P> mappedClass, final UsGroupOrgDto findListUsGroupOrg) {
		return ContextHolder.getBean(UsGroupOrgDao.class).findListByLikeCode(mappedClass, findListUsGroupOrg);
	}

	@Override
	public int insertByCode(final UsGroupOrgDto insertUsGroupOrg) {
		return ContextHolder.getBean(UsGroupOrgDao.class).insertByCode(insertUsGroupOrg);
	}

	@Override
	public <P> PaginationDto<P> paginationByLikeCode(final Class<P> mappedClass, final UsGroupOrgDto paginationUsGroupOrg) {
		return ContextHolder.getBean(UsGroupOrgDao.class).paginationByLikeCode(mappedClass, paginationUsGroupOrg);
	}

	@Override
	public Integer readByCodeNqIdForCount(final UsGroupOrgDto readUsGroupOrg) {
		return ContextHolder.getBean(UsGroupOrgDao.class).readByCodeNqIdForCount(readUsGroupOrg);
	}

	@Override
	public <P> P saveByIdOrCode(final Class<P> mappedClass, final UsGroupOrgDto saveUsGroupOrg) {
		return ContextHolder.getBean(UsGroupOrgDao.class).saveByIdOrCode(mappedClass, saveUsGroupOrg);
	}

	@Override
	public int updateByCode(final UsGroupOrgDto updateUsGroupOrg) {
		return ContextHolder.getBean(UsGroupOrgDao.class).updateByCode(updateUsGroupOrg);
	}
}